package com.qingzhi.spring.demo.service;

import com.qingzhi.spring.demo.mapper.MessageInfoMapper;
import com.qingzhi.spring.demo.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    MessageInfoMapper messageInfoMapper;

    public void addMessage(MessageInfo messageInfo) {
        messageInfoMapper.insertMessage(messageInfo);
    }

    public List<MessageInfo> getList() {
        return messageInfoMapper.queryAll();
    }
}
